package com.j180.service.impl;

import com.j180.bean.BookBean;
import com.j180.dao.IBookDao;
import com.j180.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BookServiceImpl implements IBookService {
    @Autowired
    private IBookDao iBookDao;

    @Override
    public List<BookBean> showAllBooks() {

        return iBookDao.getAllBooks();
    }

    @Override
    public BookBean showBookById(int id) {
        return  iBookDao.getBookById(id);
    }

    @Override
    public int addBook(BookBean bookBean) {
        return iBookDao.insertBook(bookBean);
    }

    @Override
    public int deleteBookInfo(int id) {
        return iBookDao.deleteBookById(id);
    }

    @Override
    public int updatetBookInfo(BookBean bookBean) {
        return iBookDao.updatetBook(bookBean);
    }
}
